package edu.Methods;

import java.util.Scanner;

public class method01 {
    public static int a01(int a,int b){
        System.out.printf("a+b=");return a + b;
    }

    public static int a02(int a,int b,int c){
        System.out.printf("a+b+c=");return a + b + c;
    }

    public static int a03(int a,int b){
        int result;
        if(a>b){
            result=a;
        }else{
            result =b;
        } return result;
    }

    public static int a04(int a,int b,int c){
        int result;
        int max;
        if(a>b){
            result=a;
        }else{
            result =b;
        }
        if(c>result){
            max=c;
        }else{
            max=result;
        }return max;
    }
    public static void main(String[] args) {
        int a,b,c;
        System.out.println("请选择你要输入几个数（2/3）");
        Scanner scan=new Scanner(System.in);
        int num=scan.nextInt();
        if(num==2){
            System.out.println("请输入这两个数（回车隔开）");
            a=scan.nextInt();
            b=scan.nextInt();
            System.out.printf("两数之和为：");
            System.out.println(a01(a,b));
            System.out.printf("两数最大值为：");
            System.out.println(a03(a,b));
        }else{
            System.out.println("请输入这三个数（回车隔开）");
            a=scan.nextInt();
            b=scan.nextInt();
            c=scan.nextInt();
            System.out.print("三数之和为：");
            System.out.println(a02(a,b,c));
            System.out.printf("三数最大值为：");
            System.out.println(a04(a,b,c));
        }

    }
}